{% extends "teacher/teacher.html" %}

{% block app_content %}
<div class="container mb-4"></div>
    <h1 class="display-6" align="center">图片管理</h1>
<div class="col">
       <form action="/picture_manage" method='POST' enctype="multipart/form-data">
{#           <button type="submit" >上传</button>#}
            <input type="file" name="file" style="margin-top:20px;"/>
            <button type="submit"  class="button-new" style="margin-top:15px;">上传课件</button>
       </form>
</div>
    <div class="container mb-4"></div>
    <div class="row">
            <table class="table table-striped table-hover">
                    <thead class="thead-dark">
                        <tr>
                            <th class="lead">课件名</th>
                            <th class="lead">格式</th>
                            <th class="lead">上传时间</th>
                            <th class="lead">课件路径</th>
                            <th class="lead">课件管理</th>
                        </tr>
                    </thead>
                    <tbody>
                        {% if pictures %}
                            {% for picture in pictures %}
                            <tr>
                               <td class="lead">{{ picture.PictureName }}</td>
                               <td class="lead">{{ picture.PictureType }}</td>
                               <td class="lead">{{ picture.RenderTime }}</td>
                               <td class="lead">{{ picture.PicturePath }}</td>
                                <td class="lead">
                                    <a href="{{ url_for("delete_picture_teacher",PictureName=picture.PictureName) }}" class="btn btn-outline-danger btn-sm" role="button">删除</a>
                                </td>
                            </tr>

                            {% endfor %}
                        {% endif %}
                    </tbody>
            </table>
    </div>
{% endblock %}